package com.wwj.nativecode;

import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.util.List;

import com.wwj.factory.NJServiceFactory;
import com.wwj.nativeInterface.INJModelService;
import com.wwj.nativeInterface.INJServer;
import com.wwj.nativeInterface.INJServiceAccess;
import com.wwj.nativecode.FileUtil;

public class Test {
	
	public static void main(String[] args)throws Exception{
		
		//Path path1 = Paths.get("E:\\NativeTest\\xiaowang\\a.txt");
		//Path path2 = Paths.get("E:\\NativeTest\\wm\\just\\b.txt");
		
		//Files.copy(path1, path2, StandardCopyOption.REPLACE_EXISTING);
		
//		if(!Files.exists(path2)){
//			Path rootpath = path2.getParent();
//			if(!Files.exists(rootpath)){
//				//创建上级所有文件夹目录
//				Files.createDirectories(rootpath);
//			}
//		    //创建文件
//			Files.createFile(path2);
//			
//		}
		
//		Files.copy(path1, path2, StandardCopyOption.REPLACE_EXISTING);
		
//		Path rootpath = path2.getParent();
//		System.out.println(rootpath.toString());
		
		//测试文件夹复制功能
//		Path path1 = Paths.get("E:\\NativeTest\\wangming");
//		Path path2 = Paths.get("E:\\NativeTest\\xiaowang");
//		
//		FileUtil.copyDir(path1, path2, StandardCopyOption.REPLACE_EXISTING);
		
		//FileUtil.copyFile(path1, path2, StandardCopyOption.REPLACE_EXISTING);
		String ip = "127.0.0.1";
		int port = 8060;
		
		INJServer pServer = NJServiceFactory.CreateServer(ip, port);
		
		System.out.println("success");
		
		INJServiceAccess pServiceAccess = pServer.CreateModelServiceAccess();
		
		List<INJModelService> list_ms;
		
		list_ms = pServiceAccess.GetModelServicesList();
		
	   
	    System.out.println("hhaa");
		
		
		
		
		
	} 
	
	
	//实现拷贝文件夹的方法
	

}
